package com.fbpost.util;

import java.io.UnsupportedEncodingException;
import org.apache.commons.lang.StringUtils;

public class StringUtil {

	/**
	 * 判断字符串是否为空
	 * 
	 * @param str
	 *            “ ”、null 都返回true
	 * @return
	 */
	public static boolean isNull(String str) {
		return (null == str || StringUtils.isBlank(str.trim()));
	}

	public static boolean isEqual(String s1, String s2) {
		if (s1 == null && s2 == null) {
			return true;
		}
		if (s1 != null && s2 == null) {
			return false;
		}
		if (s2 != null && s1 == null) {
			return false;
		}
		if (s1.equals(s2)) {
			return true;
		}
		return false;
	}
}